/***********************************************************************************************************************
 * 
 * > QuadroCore <
 * 
 * Copyright (C) 2012 by Chris Channing
 *
 ***********************************************************************************************************************
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 ***********************************************************************************************************************/

#ifndef LCDPIX_H_
#define LCDPIX_H_

#define LCD_ROW_WIDTH (LCD_WIDTH / 8)

typedef struct _LCDCanvas
{
	BYTEP bufferP;
	bool_t directDraw;
} LCDCanvas_t;

typedef LCDCanvas_t* LCDCANVASP;

typedef struct _LCDPixelMapping
{
	uint8_t page;
	uint8_t column;
	uint8_t pixelX;
	uint8_t pixelY;
	uint8_t pageStartPixelX;
	uint8_t pageStartPixelY;
} LCDPixelMapping_t;

typedef LCDPixelMapping_t* LCDPIXMAPP;

void LCDCanvasInit(bool_t directDraw);
void LCDCanvasShutdown(void);
LCDCANVASP LCDCanvasAlloc(bool_t directDraw);
void LCDCanvasFree(LCDCANVASP lcdCanvasP);
void LCDCanvasClear(void);

void LCDCanvasEnableDirectDraw(void);
void LCDCanvasDisableDirectDraw(void);

void LCDCanvasDrawPixel(uint8_t x, uint8_t y);
void LCDCanvasClearPixel(uint8_t x, uint8_t y);
void LCDCanvasFlush(void);

void LCDCanvasDrawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2);
void LCDCanvasDrawBox(uint8_t x, uint8_t y, uint8_t height, uint8_t width, bool_t fill);

#endif /* LCDPIX_H_ */